<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/plugin/select2/select2.css"/>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<style type="text/css">
    .carowner_1, .carowner_2 {
        display: block;
        margin-top: 10px;
        width: 100%;
        height: 25px;
    }

    .carowner_2 {
        margin-left: 0px;
    }

    .select_model {
        -moz-appearance: none;
        background: rgba(0, 0, 0, 0) url("<?php echo get_style_cdnurl();?>paimai/yunying/images/sanjiao.jpg") no-repeat scroll 115px 5px;
        border: 1px solid #d7d7d7;
        float: left;
        height: 25px;
        line-height: 25px;
        margin-right: 8px;
        text-indent: 2px;
        width: 136px;
    }

    .text_model {
        border: 1px solid #d7d7d7;
        float: left;
        height: 24px;
        line-height: 24px;
        margin: 0 10px 10px 0;
        text-align: center;
        width: 135px;
    }

    .search_btn, .export_btn {
        height: 26px;
        line-height: 26px;
        background: #20ab4f none repeat scroll 0 0;
        border-radius: 3px;
        border: medium none;
        color: #fff;
        margin-left: 7px;
        padding: 0;
        width: 60px;
        float: left;
    }

    .bidding_time {
        float: left;
    }

    .table .mcenter {
        vertical-align: middle;
        text-align: center;
    }

    #bidding_start_time, #bidding_end_time {
        border: 1px solid #d7d7d7;
        height: 24px;
        line-height: 24px;
        margin: 0 5px;
        padding-left: 15px;
        width: 135px;
    }

    .bidding_time input {
        background: rgba(0, 0, 0, 0) url("<?php echo get_style_cdnurl();?>paimai/yunying/images/time_pic.jpg") no-repeat scroll 125px 5px;
    }
</style>
</head>
<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>
<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'cxtj.ppcx'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>
    <div class="mianR">
        <div class='carowner_1'>
            <select name="time_mode" id="time_mode" class="select_model">
                <option value="0">请选择时间类型</option>
                <option value="1">竞拍开始时间</option>
                <option value="2">过户完成时间</option>
            </select>
            <div class="bidding_time">
                <input type="text" name="start_time" placeholder="请选择开始时间" value="" class="xiaci xin-text1"
                       id="bidding_start_time" readonly>
                <input type="text" name="end_time" placeholder="请选择结束时间" value="" class="xiaci xin-text1"
                       id="bidding_end_time" readonly/>
            </div>
            <select name="order_status" id="order_status" class="select_model">
                <option value="0">请选择拍品状态</option>
                <option value="0">全部</option>
                <?php $status_list = C("ORDER_STATUS");?>
                <?php if(is_array($status_list)): $i = 0; $__LIST__ = $status_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sl): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"><?php echo ($sl); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
            </select>

            <select name="pay_status" id="pay_status" class="select_model">
                <option value="0">请选择付款状态</option>
                <?php if(is_array($order_pay_status)): $i = 0; $__LIST__ = $order_pay_status;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$ops): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"><?php echo ($ops); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
            </select>

            <div class="source_input">
                <input type="text" name="comefrom" value="" placeholder="请选择渠道来源" readOnly/>
                <div class="source">
                    <ul>
                        <?php foreach($pfrom as $item):?>
                        <li date="<?php echo ($item["from_id"]); ?>"><?php echo ($item["from_name"]); ?></li>
                        <?php endforeach;?>
                    </ul>
                </div>
                <div class="sourceCity">
                    <ul>
                        <?php if(is_array($bc_city)): foreach($bc_city as $k=>$vo): ?><li date-city="<?php echo ($k); ?>"><?php echo ($vo); ?></li><?php endforeach; endif; ?>
                    </ul>
                </div>
                <div class="sourceTab">
                    <?php if(is_array($comefrom_list)): foreach($comefrom_list as $k=>$cl): ?><div class="sourceList" date-pid="<?php echo ($k); ?>">
                            <ul>
                                <?php if(is_array($cl)): foreach($cl as $key=>$clv): ?><li date-id="<?php echo ($clv["from_id"]); ?>"><?php echo ($clv["from_name"]); ?></li><?php endforeach; endif; ?>
                            </ul>
                        </div><?php endforeach; endif; ?>

                    <div class="sourceList siSdian">
                        <?php if(is_array($city_fours_list)): foreach($city_fours_list as $k=>$cfl): ?><ul style="display: none;" date-code-city="<?php echo ($k); ?>">
                                <?php if(is_array($cfl)): foreach($cfl as $key=>$cflv): ?><li date-id="<?php echo ($cflv["from_id"]); ?>"><?php echo ($cflv["from_name"]); ?></li><?php endforeach; endif; ?>
                            </ul><?php endforeach; endif; ?>
                    </div>
                </div>
            </div>

        </div>
        <div class='carowner_2'>
            <input type="text" id="order_no" name="order_no" value="" placeholder="拍单编号" class="text_model" style="margin: 0 10px 10px 0;"/>
            <input type="text" id="car_level" name="car_level" value="" placeholder="级别" class="text_model"/>
            <input type="text" id="car_plate_number" name="car_plate_number" value="" placeholder="车牌号"
                   class="text_model"/>
            <select name="location_area" id="location_area" class="select_model" style="color: #7f7f7f;">
                <?php if(count($bc_city) > 1): ?><option value="0">请选择所在地</option><?php endif; ?>
                <?php if(is_array($bc_city)): foreach($bc_city as $k=>$vo): ?><option value="<?php echo ($k); ?>"><?php echo ($vo); ?></option><?php endforeach; endif; ?>
            </select>
            <input type="button" id="search" value="搜索" class="search_btn">
            <input type="button" id="export" value="导出" class="export_btn" style="display:none;">
            <div class='clear'></div>
        </div>

        <div class="yuList">
            <div class="listBox" id="listBox"></div>
        </div>

        <div id="showOption" style="display:none">
            <?php if(is_array($from)): $i = 0; $__LIST__ = $from;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option class="<?php echo ($vo['pid']); ?>" value="<?php echo ($vo['from_id']); ?>"><?php echo ($vo['from_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </div>

    </div>
    <div class="clear"></div>
    <div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>

    <script type="text/javascript">
        $("#time_mode").change(function(){
            var time_mode = $(this).val();
            change_search_time(time_mode);
        });
        function change_search_time(time_mode){
            if(time_mode == 0 || time_mode == 1){
                $('#bidding,#bidding_td').show();
                $('#transfer,#transfer_td').hide();
            }else if(time_mode == 2){
                $('#transfer,#transfer_td').show();
                $('#bidding,#bidding_td').hide();
            }
        }

        $("body,html").click(function (event) {
            $(".sourceCity").hide();
            $(".sourceTab .sourceList").hide();
            $(".source").hide();
            event.stopPropagation();
        });

        $(".source_input").click(function (event) {
            event.stopPropagation();
        });
        $(".source_input input").val("");
        $(".source_input input").click(function () {
            if ($(".source").css("display") == "none") {
                $(".source").fadeIn();
            } else {
                $(".source").hide();
            }
            $(".sourceCity").hide();
            $(".sourceTab .sourceList").hide();
        });
        var index;
        var text;
        var dateIndex;
        $(".source ul li").click(function () {
            index = $(".source ul li").index(this);
            text = $(this).html();
            dateIndex = $(this).attr("date");
            if (dateIndex == 5) {
                $(".sourceCity").fadeIn();
                $(".sourceTab .sourceList").hide();
            } else {
                $(".sourceCity").hide();
                $(".sourceTab .sourceList[date-pid='" + dateIndex + "']").fadeIn().siblings().hide();
            }
            $(this).parent().parent().hide();
        });
        var city;
        var cityIndex;
        $(".sourceCity ul li").click(function (i) {
            city = $(this).html();
            $(this).parent().parent().hide();
            cityIndex = $(this).attr("date-city");
            $(".sourceTab .siSdian").fadeIn().find("ul[date-code-city='" + cityIndex + "']").fadeIn().siblings().hide();
        })
        $(".sourceList ul li").click(function () {
            $(this).parent().parent().hide();
            if (index == 3) {
                $(".source_input input").val(text + " - " + city + " - " + $(this).html());
                $(".source_input input").attr("real-value", $(this).attr("date-id"));
            } else {
                $(".source_input input").val(text + " - " + $(this).html());
                $(".source_input input").attr("real-value", $(this).attr("date-id"));
            }
        });

        //付款状态
        $("#order_status").change(function () {
            var order_status = $(this).val();
            if ((order_status >= 8 || order_status == 0) && order_status != 301 && order_status != 52 && order_status != 71) {
                $("#pay_status").removeAttr("disabled");
            } else {
                $("#pay_status option:first").prop("selected", 'selected');
                $("#pay_status").attr("disabled", true);
            }
        });

        $("#bidding_start_time").ymdateplugin({
//            showTimePanel: true,
//            changeMonth: true,
//            changeYear: true
        });
        $("#bidding_end_time").ymdateplugin({
//            showTimePanel: true,
//            changeMonth: true,
//            changeYear: true
        });
        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null)
                return unescape(r[2]);
            return null; //返回参数值
        }
        get_list();
        function get_list(isSearch) {
            var url = get_url();
            var purl = '';
            if (isSearch != 1) {
                var p = getUrlParam('p');
                if (p != null) {
                    purl = "?p=" + p;
                } else {
                    purl = "?p=1";
                }
            }
            $.get("/OrderCheck/order_list" + purl, encodeURI(url), function (data) {
                $("#listBox").html(data);
                var time_mode = $("#time_mode").val();
                change_search_time(time_mode);
                var order_status = $("#order_status").val();
                if (order_status == 126) {
                    var total = $("#total").val();
                    if (total > 0) {
                        $('.export_btn').show();
                    } else {
                        $('.export_btn').hide();
                    }
                } else {
                    $('.export_btn').hide();
                }
            }, "html");
        }

        function get_page(p) {
            var url = get_url();
            url += "&p=" + p;
            $.get("/OrderCheck/order_list", encodeURI(url), function (data) {
                $("#listBox").html(data);
                var time_mode = $("#time_mode").val();
                change_search_time(time_mode);
            }, "html");
        }
        $(".search_btn").on("click", function () {
            var isSearch = 1;
            get_list(isSearch);
        });
        $(".export_btn").on("click", function () {
            var url = get_url();
            window.location.href = "/OrderCheck/export_order_list?action=export" + url;
            // $.get("/OrderCheck/export_order_list", encodeURI(url), function (data) {
            //      if(data.code != 200){
            //          btn_alert(data.msg);
            //      }
            //  }, "json");

        });

        function get_url() {
            var url = "";
            var time_mode = $("#time_mode").val();
            var start_time = $("input[name='start_time']").val();
            var end_time = $("input[name='end_time']").val();
            var order_status = $("#order_status").val();
            var pay_status = $("#pay_status").val();
            var location_area = $("#location_area").val();
            var comefrom = $("input[name='comefrom']").attr('real-value');
            var order_no = $("#order_no").val();
            var car_level = $("#car_level").val();
            var car_plate_number = $("#car_plate_number").val();
            if (time_mode) {
                url += '&time_mode=' + time_mode;
            }
            if (start_time) {
                url += '&start_time=' + start_time;
            }
            if (end_time) {
                url += '&end_time=' + end_time;
            }
            if (order_status) {
                url += '&order_status=' + order_status;
            }
            if (pay_status) {
                url += '&pay_status=' + pay_status;
            }
            if (location_area) {
                url += '&location_area=' + location_area;
            }
            if (comefrom) {
                url += '&comefrom=' + comefrom;
            }
            if (order_no) {
                url += '&order_no=' + order_no;
            }
            if (car_level) {
                url += '&car_level=' + car_level;
            }
            if (car_plate_number) {
                url += '&car_plate_number=' + car_plate_number;
            }
            return url;
        }
        $("#from").change(function () {
            var value = $(this).val(); //获取渠道当前下拉列表选中的值
            //隐藏所有下拉列表的值
            $("#comeFrom option").each(function () {
                if ($(this).val() != '') {
                    $(this).remove();
                }
            });

            //显示具体渠道下拉列表
            $("#showOption option").each(function () {
                if ($(this).val() == '' || $(this).attr("class") == value) { //通过判断class名称判断是否显示
                    $("#comeFrom").append($(this).clone(true)); //为Select追加一个Option(下拉项)
                    if ($(this).val() == '') {
                        $(this).prop("selected", true)
                    }
                }
            });
        });
    </script>